When you run Eleventy, it processes your .md files and builds the _site folder in a strict sequence:

  1. Read Configuration (Docs: Configuration) Eleventy loads eleventy.config.js first to check your input/output directories (src and _site), passthrough copy rules, filters, and plugins.
  2. Copy Static Assets (Docs: Passthrough File Copy) Anything registered with addPassthroughCopy (like img, css, and admin) is copied directly into _site without modification.
  3. Load Global Data (Docs: Global Data Files) Eleventy reads all files inside _data/ (like site.js) and makes their exported values globally available to every template.
  4. Scan and Map Files (Docs: Permalinks & Input/Output Directories) Eleventy scans src/ for template files (.md, .njk, .html), ignoring _includes and _data, and calculates each page's output URL (e.g., src/about.md maps to _site/about/index.html).
  5. Merge the Data Cascade (Docs: Data Cascade) For each .md file, Eleventy combines data from lowest to highest priority:
  • Global data (_data/)
  • Directory data files (e.g., posts/posts.json)
  • Template data files (e.g., about.json)
  • The file's own YAML front matter (highest priority)
  1. Build Collections (Docs: Collections) Eleventy inspects the merged tags on every page and groups matching pages into collections (such as collections.post).
  2. Render Markdown to HTML (Docs: Template Languages — Markdown) Eleventy processes any Nunjucks/Liquid tags inside the .md body first, then runs the Markdown parser (markdown-it) to convert the Markdown syntax into raw HTML fragments.
  3. Wrap in Layouts (Docs: Layouts & Layout Chaining) Eleventy looks at the layout variable (like layout.njk), injects the converted HTML fragment into {{ content | safe }}, and repeats this step if layouts are chained together.
  4. Write Final Files (Docs: Transforms & Events) Eleventy runs any post-processing transforms (such as HTML minifiers) and writes the finished HTML files to _site/.